#include "dialog.h"
#include "ui_dialog.h"
#include <QLabel>


Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    mLePwd = new QLineEdit();
    mBtnOK = new QPushButton("ok");
    mVBLGlobal = new QVBoxLayout;
    mVBLGlobal->addWidget(mLePwd);
    mVBLGlobal->addWidget(mBtnOK);

    this->setLayout(mVBLGlobal);

    connect(mBtnOK,SIGNAL(clicked()),this,SLOT(onBtnOkClicked()));
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::onBtnOkClicked()
{
    QString str = mLePwd->text();
    emit okClicked(str);
    this->accept();
}

